<?PHP
/* Generieke definitie file */
include_once 'defs/constants.php';


/* Taal specifieke tekst */

include_once DIR_LANGUAGE. 'nl/general.php';

include_once DIR_CLASS.FILE_MARKETING;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style_marketing.css" rel="stylesheet" type="text/css" />
<title>MinEvents - Klant aanmaken</title>
<script type="text/javascript">
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is vereist.\n'; }
    } if (errors) alert('De volgende problemen zijn gevonden\n'+errors);
    document.MM_returnValue = (errors == '');
} }
</script>

</head>

<body>
<!-- begin wrapper_achtergrond -->	<div class="wrapper_achtergrond">
<!-- begin wrapper--> 				<div class="wrapper">

<!-- begin header-->				<div class="header">

<!-- begin header_logo-->			<div class="header_logo">
<!-- einde header_logo-->			</div>


<!-- begin header_menu-->			<div class="header_menu">

<!-- begin header_instellingen-->	<div class="header_instellingen">
									<a href="#"><img src="images/instellingen.png" /></a>
<!-- einde header_instellingen-->	</div>

<!-- begin header_instellingen-->	<div class="header_FAQ">
									<a href="#"><img src="images/faq.png" /></a>
<!-- einde header_instellingen-->	</div>

<!-- begin header_instellingen-->	<div class="header_uitloggen">
									<a href="#"><img src="images/uitloggen.png" /></a>
<!-- einde header_instellingen-->	</div>

<!-- einde header_menu-->			</div>

<!-- einde header-->				</div>

									<div class="sidebar">

									<div class="home_button">
                                    <a href="../index.php"><img src="images/home_button.png" /></a>
                                    </div>

									<div class="kleine_button_1">
                                    <div class="kleine_button_1_titel"><a href="marketing_klant_aanmaak.php">Klant aanmaken</a></div>
									</div>
                                    

									<div class="kleine_button_2">
                                    <div class="kleine_button_2_titel"><a href="../marketing1.php">Klant bewerken</a></div>
									</div>

									<div class="kleine_button_3">
                                    <div class="kleine_button_3_titel"><a href="marketing_klant_overzicht.php">Klant overzicht</a></div>
									</div>
                                    
                                    </div>

<div class="content">
<font size="+2"> Klant Aanmaken </font>
<br /><br />
<table width="350" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><form action="" method="post" name="form1">
<table width="350" border="0" cellpadding="0" cellspacing="5" onfocus="MM_validateForm('voorkeuren','','R','voornaam','','R','achternaam','R','postcode','R','geboortedatum','R','emailadres',);return document.MM_returnValue">
<tr>
<td width="105">Voorkeur</td>
<td width="16">:</td>
<td width="222">
    <select input name="voorkeuren" id="voorkeuren">
        
<option
    value="1" id="bowling">
Bowling
<option
    value="2" id="brasserie">
Brasserie
</option>
<option
    value="3" id="feestzaal">
Feestzaal
</option>
<option
    value="4" id="speelzaal">
Speelzaal
</option>
<option
    value="5" id="terras">
Terras
</option>
<option
    value="6" id="lasergame">
Lasergame
</option>
<option
    value="7" id="overig">
Overig
</option>
</select>
* </td>
</tr>

<tr>
<td>Voornaam</td>
<td>:</td>
<td><input name="voornaam" type="text" id="voornaam" maxlength="64"> 
* </td>
</td>
</tr>

<tr>
<td>Achternaam</td>
<td>:</td>
<td><input name="achternaam" type="text" id="achternaam" maxlength="32"> 
* </td>
</tr>

<tr>
<td>Postcode</td>
<td>:</td>
<td><input name="postcode" type="text" id="postcode" maxlength="32"> 
 </td>
</tr>

<tr>
<td>Geboortedatum</td>
<td>:</td>
<td><input name="geboortedatum" type="text" id="geboortedatum" maxlength="32"> 
* </td>
</tr>

<tr>
<td>Emailadres</td>
<td>:</td>
<td><input name="emailadres" type="text" id="emailadres" maxlength="32"> 
* </td>
</tr>




<tr>
<td>&nbsp;</td>
<td></td>
<td><input name="Verzenden" input type="submit" onclick="MM_validateForm('voorkeuren','','R','voornaam','','R','achternaam','R','postcode','R','geboortedatum','R','emailadres',);return document.MM_returnValue" value="Verzenden">
</td>
</tr>
</table>
<?PHP
//Notice about undefined index, not useful to user.
if(isset($_POST['Verzenden'])) {
@($_POST['voorkeuren']);
@($_POST['voornaam']);
@($_POST['achternaam']);
@($_POST['postcode']);
@($_POST['geboortedatum']);

$voornaam=$_POST['voornaam'];
$achternaam=$_POST['achternaam'];
$postcode=$_POST['postcode'];
$geboortedatum=$_POST['geboortedatum'];

        $marketing= new Marketing();

        $marketing->setVoorkeuren('1');
		$marketing->setVoornaam($voornaam);
		$marketing->setAchternaam($achternaam);
		$marketing->setPostcode($postcode);
		$marketing->setGeboortedatum($geboortedatum);		

        $marketing->saveKlant();
     
        echo "Beste " . ($voornaam) . " " . ($achternaam). "<br>";
        echo "bedankt voor het registreren van u gegevens, ";
		echo "door het registreren kunt u nu leuke aanbiedingen en kortingen ontvangen. ";			
}
?>
</form></td>
</tr>
</table>

</div>

<div class="footer">
Realisatie: Stichting Innovision Solutions
</div>
<!-- einde footer -->				</div>
<!-- einde wrapper -->				</div>
<!-- einde wrapper_achtergrond -->	</div>
</body>
</html>
